package com.pengshun.modules.api.system.domain;

import com.fasterxml.jackson.annotation.JsonView;
import com.pengshun.modules.api.coal.validator.First;
import com.pengshun.modules.api.coal.validator.Second;
import com.pengshun.modules.common.ReslutView;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

@Data
public class CityDto {

    @NotNull(message = "cityId不能为空", groups = {First.class})
    @JsonView({ReslutView.aView.class,ReslutView.bView.class})
    private  Integer cityId;
    @JsonView({ReslutView.aView.class,ReslutView.bView.class})
    private String city;

    @NotNull(message = "provinceId不能为空", groups = {Second.class})
    private Integer provinceId;
    @JsonView({ReslutView.bView.class})
    private String firstLetter;
    private String secondLetter;
    @JsonView(ReslutView.aView.class)
    private List<District> districtList;

    public CityDto(  Integer cityId, String city,  Integer provinceId, String firstLetter) {
        this.cityId = cityId;
        this.city = city;
        this.provinceId = provinceId;
        this.firstLetter = firstLetter;
    }
}
